import request from "@/utils/request";
import Conf from "@/utils/conf";
const baseURL = Conf.LZD_ENABLED;
// 管理员权限
export const getAdministratorApi = () => {
  return request({
    baseURL,
    url: "/biz/manage/audit-auth",
    method: "get",
  });
};
// 获取附件ID
export const getAttachmentIDApi = (value) => {
  return request({
    baseURL,
    url: "/biz/manage/attachment",
    method: "post",
    params: value,
  });
};
// 新增文件
export const getNewFileApi = (data) => {
  return request({
    baseURL,
    url: "/biz/manage/upload",
    method: "post",
    data: data,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};
// 查询文件表格
export const getQueryFileApi = (value) => {
  return request({
    baseURL,
    url: "/biz/manage/list",
    params: value,
  });
};
// 查询文件列表
export const getQueryFileListApi = (value) => {
  return request({
    baseURL,
    url: `/biz/manage/file-list/${value}`,
  });
};
// 预览文件
export const getPreviewFileApi = (value) => {
  return request({
    baseURL,
    url: `/biz/manage/preview/${value}`,
  });
};
// 下载文件
export const getDownloadTheFileApi = (value) => {
  return request({
    baseURL,
    url: `/biz/manage/download/${value}`,
    method: "get",
  });
};
// 删除文件
export const deleteFileApi = (value) => {
  return request({
    baseURL,
    url: `/biz/manage/${value}`,
    method: "delete",
  });
};
// 导出文件夹
export const exportFoldersApi = (value) => {
  return request({
    baseURL,
    responseType: 'blob',
    url: "/biz/manage/export",
    method: "post",
    params: value,
  });
};
// 删除（批量）文件夹
export const deleteFoldersApi = (value) => {
  return request({
    baseURL,
    headers: {
      "Content-Type": "application/json",
    },
    url: "/biz/manage/delete-folders",
    method: "post",
    data: value,
  });
};
// 下载文件夹
export const downloadFoldersApi = (value) => {
  return request({
    baseURL,
    responseType: 'blob',
    headers: {
      "Content-Type": "application/json",
    },
    url: "/biz/manage/batch-download-folder",
    method: "post",
    data: value,
  });
};
